import os
import pandas as pd
from sklearn.utils import shuffle


if __name__ == '__main__':
    path = "hscode/"
    pd_all = pd.read_csv(os.path.join(path, "hscode.txt"), sep='\t' )
    pd_all = shuffle(pd_all)

    position = int(pd_all.shape[0]/10);
    dev_set = pd_all.iloc[0:position]
    test_set = pd_all.iloc[position:position + position]
    train_set = pd_all.iloc[position+position: int(pd_all.shape[0])]
    dev_set.to_csv("hscode/dev.tsv", index=False, sep='\t')
    test_set.to_csv("hscode/test.tsv", index=False, sep='\t')
    train_set.to_csv("hscode/train.tsv", index=False, sep='\t')